//============================================================================================
/**
 * @file	comm_command_pkthln.c
 * @brief	ポケスロン通信コマンド
 * @author	Nozomu Saito
 */
//============================================================================================

#include "common.h"
#include "communication/communication.h"
#include "comm_command_pkthln.h"

#include "comm_command_pkthln_func.h"

// 対応するコールバック関数
static const CommPacketTbl _CommPokethlonPacketTbl[] = {
	//-------------------------------------
	//　ゲーム用
	//=====================================
	{CommPkthlnSetEventNo,CommPkthlnGetEventNoSize, NULL},
	{CommPkthlnPokeAddUp, CommPkthlnGetPokeAddUpSize, NULL},
	{CommPkthlnGetAllPokeData, CommPkthlnGetAllPokeDataSize, NULL},
	{CommPkthlnSetMyStatus, CommPkthlnGetAllMyStatusSize, NULL},
	{CommPkthlnGetMyRankData, CommPkthlnGetRankDataSize, CommPkthlnGetOrgRankDatBufAdr},
///	{CommPkthlnReciveRankData, CommPkthlnGetAllRankDataSize, CommPkthlnGetRankDatBufAdr},
	{CommPkthlnGetEvtCmnData, CommPkthlnGetEvtCmnDataSize, NULL},
	{CommPkthlnGetEvtShareData, _getVariable, CommPkthlnGetShareDatBufAdr},
	{CommPkthlnEvtResultAddUp, CommPkthlnGetEvtCmnDataSize, NULL},
	{CommPkthlnGetAllEvtResult,CommPkthlnGetEvtCmnDataSize, NULL},
	{CommPkthlnSendEvtActData, CommPkthlnGetEvtActionDataSize, CommPkthlnGetMyEvtActionDatBufAdr},
	{CommPkthlnShareEvtActData, CommPkthlnGetAllEvtActionDataSize, CommPkthlnGetEvtActionDatBufAdr},
	{CommPkthlnSendJuiceData, CommPkthlnGetJuiceDataSize, CommPkthlnGetJuiceDatBufAdr},
///	{CommPkthlnShareJuiceData, CommPkthlnGetAllJuiceDataSize, CommPkthlnGetAllJuiceDatBufAdr},

	//↑リングバッファに入らないので自前でバッファを作る
};

//----------------------------------------------------------------------------
/**
 *	@brief	コマンドテーブルを取得
 *
 *	@param	void
 *
 *	@return	CommPacketTbl*		通信パケットテーブル
 */
//-----------------------------------------------------------------------------
const CommPacketTbl* PKTHLN_GetCommCommandTbl( void )
{
	return _CommPokethlonPacketTbl;
}

//----------------------------------------------------------------------------
/**
 *	@brief	コマンドテーブル要素数を取得
 *
 *	@param	void
 *
 *	@return	int		要素数
 */
//-----------------------------------------------------------------------------
int PKTHLN_GetCommCommandTblNum( void )
{
    return sizeof(_CommPokethlonPacketTbl)/sizeof(CommPacketTbl);
}